# -*- coding: utf-8 -*-

# Define here the models for your scraped items
#
# See documentation in:
# https://doc.scrapy.org/en/latest/topics/items.html

import scrapy


class EtherscanSpiderItem(scrapy.Item):
    # define the fields for your item here like:
    # name = scrapy.Field()
    pass

class BlockinfoItem(scrapy.Item):
    height = scrapy.Field()    # 区块高度
    timestamp = scrapy.Field()  # 时间戳
    transaction_num = scrapy.Field()  # 外部交易数
    internal_transaction_num = scrapy.Field()  # 内部交易数
    hash = scrapy.Field()  # 区块的哈希值
    parent_hash = scrapy.Field()  # 父区块的哈希值
    mined_by = scrapy.Field()  # 矿工哈希值
    difficulty = scrapy.Field()  # 开采难度
    total_difficulty = scrapy.Field()  # 开采总难度
    size = scrapy.Field()  # 区块大小
    gas_used = scrapy.Field()  # 燃料消耗量
    gas_limit = scrapy.Field()  # 燃料上限
    nonce = scrapy.Field()  # 随机数
    block_reward = scrapy.Field()  # 区块奖励
    extra_date = scrapy.Field()  # 额外信息
    ether_txfee_avg = scrapy.Field()  # 以太交易手续费均值
    other_contract_txfee_avg = scrapy.Field()  # 其他智能合约交易手续费均值
    all_txfee_avg = scrapy.Field()  # 所有交易手续费均值
    contract_persent = scrapy.Field()  # 合约占总交易数的比值

    # # 测试数据
    # total_txfee = scrapy.Field()
    # txcount = scrapy.Field()
    # total_internal_txfee = scrapy.Field()
    # internal_txcount = scrapy.Field()
    # is_failed = scrapy.Field()
    # is_contract = scrapy.Field()